hi everybody
here is the question
write a program using functios to find out the average of three marks(m1,m2,m3)of n number of students , the function should read the 3 marks and calculate the average and anther function to take the average and print the grade depending on the following category .
the main call the two functions
60-70 pass
71-80 good
81-90 v.good
91-100 excellent
this is what i've wrote so far
Code:
#include <stdio.h>
#include <stdlib.h>
double avg (int m1 ,int m2, int m3);
void cate (void);
int main()
{
int m1,m2,m3 ;
printf("Enter the first mark\n");
scanf("%d",&m1);
printf("Enter the second mark\n");
scanf("%d",&m2);
printf("enter the third mark\n");
scanf("%d",&m3);
printf("the average is %f\n",avg(m1,m2,m3));
cate();
return 0;
}
double avg (int m1 ,int m2,int m3)
{
return((m1+m2+m3)/3);
}
void cate (void)
{
double avg ();
if ( avg >=60 && avg <=70){
printf("pass");
}
else if ( avg >=71 && avg <= 80){
printf ("good");
}
else if ( avg >=81 && avg <= 90){
printf("v.good");
}
else
printf("excellent");
}
the problem is that i keep taking this messege
in function 'cate'
warning: a comparison between a pointer and integer (line 25)
warning: a comparison between a pointer and integer (line 25)
warning: a comparison between a pointer and integer (line 28)
warning: a comparison between a pointer and integer (line 28)
warning: a comparison between a pointer and integer (line 29)
so any help about this?? please